import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

/**
 * 
 */

/**
 * @author Abubakr
 * 
 */
public class Main {
	BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

	/**
	 * @throws IOException
	 *             Lazy method.
	 */
	public Main() throws IOException {
		System.out
				.println("Continue to enter integer numbers. When you're done input nothing.");
		System.out.println("1. Array List \n2. HashSet");
		String input = in.readLine();
		switch (Integer.parseInt(input)) {
		case 1:
			ArrayList<Double> numbers = new ArrayList<Double>();
			do {
				input = in.readLine();
				if (!input.equals("")) {
					numbers.add(Double.parseDouble(input));
				}
			} while (!input.equals(""));
			numbers.remove(numbers.size() - 1);
			double total = 0;
			for (Double total1 : numbers) {
				total += total1;
			}
			System.out.println("The average of " + numbers + "is "
					+ (total / numbers.size()) + ".");
			break;
		case 2:
			HashSet<Double> numbers1 = new HashSet<Double>();
			do {
				input = in.readLine();
				if (!input.equals("")) {
					numbers1.add(Double.parseDouble(input));
				}
			} while (!input.equals(""));
			double total1 = 0;
			for (Double total11 : numbers1) {
				total1 += total11;
			}
			System.out.println("The average of " + numbers1 + "is "
					+ (total1 / numbers1.size()) + ".");
		}
	}

	/**
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		new Main();
	}

}
